The SmartThings Core SDK is a wrapper designed to simplify the use of the SmartThings REST API from JavaScript and TypeScript applications. This is the very first release of this SDK and should be considered a work in progress. Changes may still be made that are not backwardly compatible.
Prerequisites
Samsung Account
SmartThings Account with at least one device
Github Account or Glitch Account
Guide
In this tutorial we will use Glitch but you should be able to follow along with any express enabled node environment.
I’m transitioning over from the ST Classic IDE. I’m excited about exploring the new development world, but I confess that I’m lost by a lot of new things at once. I’m new to node.js, new to Glitch, etc. I can follow the recipes to download the dev tools, but I could really use a tutorial that describes how it fits together… not just click-here-then-do-this.
Also, I downloaded node.js, cloned the Git repository, etc. But when I fire up node.js, I just get a command line window… not the - apparently - browser based develpment environment that is in this video tutorial.
I’m not a newbie to development in a broad sense, but I’m new to nearly every one of these tools, and I could use some basic orientation to get me off the ground.
The development environment shown in the videotutorial is Glitch, a tool to create web applications easily that allows us to run them without having to install any software. To create a copy of the project, you can do the following:
Go to the link of the demo project on Glitch.
In the upper right corner, click on “remix to edit”
Another option is, to download Node JS, and use it through another IDE, such as Visual Studio Code; you can copy the same code and It will work after installing the corresponding dependencies in the package.json file.
Now that you downloaded the Core SDK repository, you can go through the structure to see the different endpoints and their functions. All them are included in your web application once you add the line const {SmartThingsClient} = require('@smartthings/core-sdk').
The SmartThings IDE (device handlers, groovey, etc) is unchanged and integrating new hub connected devices is pretty much as it was.
Now there’s a whole new world of well documented ST APIs to access ST from apps outside of the device-level development world. This is where all the new stuff comes in. So for instance, if we’re not psyched with ActionTiles, we could write our own cloud-based app, using these APIs to make our ActionTiles++, or whatever.
I don’t think this one is quite right. It is true right now, but things are changing in phases. I believe Phase 3 will remove the Groovy-based SmartThings IDE by some time next year.